package mc.support.crawler;

import com.alibaba.fastjson.annotation.JSONField;
import mc.support.web.WebConstants;

import java.util.Date;

/**
 * Created with IntelliJ IDEA. <br/>
 * User: francis    <br/>
 * Date: 13-11-6    <br/>
 * Time: 16:51  <br/>
 */
public class Rank {
    private Long itemId;
    private String imgUrl;
    private String title;
    private Integer pageIndex;
    private Integer indexInPage;
    private String keyword;
    private SortType sortType;
    private SourceType sourceType;
    @JSONField( format = WebConstants.GLOBAL_DATE_FORMAT )
    private Date delistTime;

    public Long getItemId() {
        return itemId;
    }

    public void setItemId(Long itemId) {
        this.itemId = itemId;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
    }

    public Integer getIndexInPage() {
        return indexInPage;
    }

    public void setIndexInPage(Integer indexInPage) {
        this.indexInPage = indexInPage;
    }

    public Date getDelistTime() {
        return delistTime;
    }

    public void setDelistTime(Date delistTime) {
        this.delistTime = delistTime;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public SortType getSortType() {
        return sortType;
    }

    public void setSortType(SortType sortType) {
        this.sortType = sortType;
    }

    public SourceType getSourceType() {
        return sourceType;
    }

    public void setSourceType(SourceType sourceType) {
        this.sourceType = sourceType;
    }

    @Override
    public boolean equals(Object obj) {
        if ( obj instanceof Rank ) {
            return this.itemId == ((Rank) obj).getItemId();
        }
        return false;
    }

    @Override
    public int hashCode() {
        return (int) ((int) ( itemId.longValue() >> 32 ) & itemId.longValue());
    }
}
